How to Remove all Staff from Bookings Appointment

Justin 1 Reputation point
2024-05-13T18:25:20.71+00:00

When Updating a Bookings Appointment that already has staff assigned, if you remove all staff members from the staffMemberIds property, the appointment will not update the assigned staff members. This operation is allowed in the webapp, so the API behavior is not consistent.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,873 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Justin 1 Reputation point
    2024-05-13T22:41:19.1066667+00:00

    This is clearly an API bug. To work around the issue, you need to take a couple unideal steps.

    1. Inject a fake ID into the staffMemberIds property. This seems to force the API to remove all assigned staff in bookings.

    "staffMemberIds" : ["00000000-0000-0000-0000-000000000000"]

    1. Unfortunately, due to the mysterious backend architecture of Bookings that MS refuses to reveal to the public, there is an ever evolving link between Bookings and Outlook Calendar Events. The above trick will not remove the Staff Member from the "Required Attendees" list with in the calendarEvent. This means there is potential for the staff to still show in other areas like Outlook.

    Because of this we need a second PATCH call to update the calendarEvent API using the booking appointment ID. In this call set the attendees property to nothing.

    "attendees": []

    Thankfully to two calls can be carried out asynchronously as you are clearing out the values in both places ensuring there is no conflict.

    Highly recommend you only use this until the dev team addresses the issue.

    0 comments No comments